$(function () {
//     var goTo=getQueryString("address");
//
//     if (goTo=="1"){
//         $(".gn").click(function () {
//             console.log(goTo);
//             $(this).addClass("active")
//         });
//
//         // var height=$("#location").offset().top;
//         // $(document).scrollTop=height;
//
//
// }
//     console.log($("#location").offset().top)

    $(".navbar .nav nav .login").hover(function () {
        $(this).css({"color":"white","border":"1px solid #00f0d1","background":"#00f0d1"})
    }).mouseout(function () {
        $(".navbar .nav nav .login").css({"color":"white","border":"1px solid white","background":"transparent"});
    })
    $(window).scroll(function () {
        //导航栏滚轮事件
        // alert(123)
        // var oHeight=$("header").outerHeight();
        // console.log(oHeight)
        if($(document).scrollTop()>0){
            $(".navbar").css({"background":"white","border-bottom":"1px solid #ebebeb"});

            $("#logo").attr("src","../img/home_logo_orange.png");
            $(".navbar .nav nav li a").css("color","#1A1A1A");
            $(".navbar .nav nav li .active").css("color","#ED5D32");
            $(".navbar .nav nav .login").css({"color":"#ED5D32","border":"1px solid #ED5D32"});

            $(".navbar .nav nav .login").hover(function () {
                $(this).css({"color":"white","border":"1px solid #00f0d1","background":"#00f0d1"})
            }).mouseout(function () {
                $(".navbar .nav nav .login").css({"color":"#00f0d1","border":"1px solid #00f0d1","background":"transparent"});
            })
        }else{
            $(".navbar").css({"background":" linear-gradient(to bottom,grey,transparent)","border-bottom":"none"});
            $(".navbar .nav nav li").eq(0).find("a").addClass("active").parent().siblings().find("a").removeClass("active")
            $("#logo").attr("src","../img/home_logo_white.png");
            $(".navbar .nav nav li a").css("color","white");
            $(".navbar .nav nav li .active").css("color","#ED5D32");
            $(".navbar .nav nav .login").css({"color":"white","border":"1px solid white"});
            $(".navbar .nav nav .login").hover(function () {
                $(this).css({"color":"white","border":"1px solid #00f0d1","background":"#00f0d1"})
            }).mouseout(function () {
                $(".navbar .nav nav .login").css({"color":"white","border":"1px solid white","background":"transparent"});
            })
        }

        // else{
        //     $(".navbar .nav nav li").eq(0).find("a").addClass("active").parent().siblings().find("a").removeClass("active")
        // }


    })
    if($(document).scrollTop()>($("#location").offset().top)-200){
        // alert(123)
        $(".navbar .nav nav li").eq(1).find("a").addClass("active").parent().siblings().find("a").removeClass("active");
        $(".navbar").css({"background":"white","border-bottom":"1px solid #ebebeb"});

        $("#logo").attr("src","newHtml/images/logo-green.png");
        $(".navbar .nav nav li a").css("color","black");
        $(".navbar .nav nav li .active").css("color","#00f0d1");
        $(".navbar .nav nav .login").css({"color":"#00f0d1","border":"1px solid #00f0d1"});

        $(".navbar .nav nav .login").hover(function () {
            $(this).css({"color":"white","border":"1px solid #00f0d1","background":"#00f0d1"})
        }).mouseout(function () {
            $(".navbar .nav nav .login").css({"color":"#00f0d1","border":"1px solid #00f0d1","background":"transparent"});
        })
    }
    // else{
    //     $(".navbar .nav nav li").eq(0).find("a").addClass("active").parent().siblings().find("a").removeClass("active")
    // }
    if($(document).scrollTop()>($("#app-down").offset().top)-200){
        // alert(123)
        $(".navbar .nav nav li").eq(3).find("a").addClass("active").parent().siblings().find("a").removeClass("active")
    }
//导航栏效果
    //导航栏效果
    // $(".navbar .nav nav ul li .dh").each(function () {
    //     $(this).click(function () {
    //         // alert(123)
    //         $(".navbar .nav nav ul li .dh").removeClass("active");
    //         $(this).addClass("active");
    //
    //     })
    //
    // });
    $(".navbar .nav nav ul li .dh").click(function () {
        $(".navbar .nav nav ul li .dh").removeClass("active");
        $(this).addClass("active");
    });

            // alert(123)







//    全局功能点效果
    var aImgsrc=[
        "img/icon_brandstation_gray.png","img/icon_usermanage_gray.png","img/icon_marcom_gray.png","img/icon_comoperation_gray.png"
    ]
    var aImgsrcl=[
        "img/icon_brandstation_white.png","img/icon_usermanage_white.png","img/icon_marcom_white.png","img/icon_comoperation_white.png"
    ];
 //    var apcimg=[
 //        "images/fw-pc.png", "images/zk-pc.png", "images/sd-pc.png",
 //        "images/sz-pc.png","images/cw-pc.png","images/bj-pc.png",
 //        "images/tz-pc.png", "images/dzqy-pc.png", "images/zx-pc.png",
 //        "images/tj-pc.png", "images/zn-pc.png","images/cb-pc.png"
 // ];
 //    var aAppimg=[
 //        "images/fw-app.png", "images/zk-app.png", "images/sd-app.png",
 //        "images/sz-app.png","images/cw-app.png","images/bj-app.png",
 //        "images/tz-app.png", "images/dzqy-app.png", "images/zx-app.png",
 //        "images/tj-app.png", "images/zn-app.png","images/cb-app.png"
 //    ];

    $(".location-content .icon .demo").each(function (a,b) {
         var ind=$(this).index();
        $(".location-content .show .computer img:gt(0)").hide();
        $(".location-content .show .iphone img:gt(1)").hide();
        $(this).find("img").attr("src",aImgsrc[a]).css({"background":"#f5f5f5"});

        $(this).mouseenter(function () {

            for(var i=0;i<aImgsrc.length;i++){
                $(".location-content .icon .demo").eq(i).find("img").attr("src",aImgsrc[i]).css({"background":"#f5f5f5"})

            }
            $(this).find("img").attr("src",aImgsrcl[a]).css({"background":"#ED5D32"});


$(".location-content .show .computer img").eq(ind).stop().fadeIn(300).siblings().hide();
            $(".location-content .show .iphone .img1").eq(ind).stop().fadeIn(300).siblings().hide();

        })
        
        $(".location-content .icon .demo").eq(0).find("img").attr("src","img/icon_brandstation_white.png").css({"background":"#ED5D32"});
        // $(".location-content .icon .demo").hover(function() {
        //     /* Stuff to do when the mouse enters the element */
        //     $(this).find("img").animate({'height': '198px'}, 300);
        // }, function() {
        //     /* Stuff to do when the mouse leaves the element */
        //     $(this).find("img").animate({'height': '30px'}, 300);
        // });


    })

//伙伴 效果
    $(".cooperation .hb").show();
    $(".cooperation .hb2").hide();
    $(".cooperation .hb3").hide();
    $(".cooperation .hb4").hide();
    $(".menu li").each(function (a,b) {
        $(this).click(function () {
            $(this).addClass("active").siblings().removeClass("active");

            $(".cooperation ul:gt(0)").eq(a).show().siblings().hide();
        })

    })
    var cooperation=[
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png",
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png",
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png"
    ]
    var cooperationL=[
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png",
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png",
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png"
    ]
    $(".huoban li").each(function (a,b) {
        $(this).mouseenter(function () {
            for(var i=0;i<cooperation.length;i++){
                $(".huoban li img").eq(i).attr("src",cooperation[i])
            }
            $(this).find("img").attr("src",cooperationL[a])
        }).mouseout(function () {
            for(var i=0;i<cooperation.length;i++){
                $(".huoban li img").eq(i).attr("src",cooperation[i])
            }

        })

    })


//8大模块

//    客户效果
    var Acust=[
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png",
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png",
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png",
        "img/logo_qygy_color.png","img/logo_gggy_color.png","img/logo_msgy_color.png","img/logo_fcgy_color.png"
        
    ];
    var Acustan=[
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png",
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png",
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png",
        "img/logo_qygy_gray.png","img/logo_gggy_gray.png","img/logo_msgy_gray.png","img/logo_fcgy_gray.png"
    ];
    var Acustancode=[
        "img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png",
        "img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png",
        "img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png","img/logo_qygy_qrcode.png",
    ];
    $(".customer li img").each(function (a,b) {
        $(this).mouseenter(function () {
            for (var i = 0; i < Acust.length; i++) {
                $(".customer li img").eq(i).attr("src", Acustan[i])
                $(".customer li .code img").eq(i).attr("src", Acustancode[i])
            }
            $(this).attr("src", Acust[a])

        }).mouseout(function () {
            for (var i = 0; i < Acust.length; i++) {
                $(".customer li img").eq(i).attr("src", Acustan[i])
                $(".customer li .code img").eq(i).attr("src", Acustancode[i])
            }
        })
    })

//领军与专业效果
    var $jl=1;
    var $ys=0;
    var $oHou=0;
    var timer=setInterval(dong,20);
    function dong() {
        $ys-=10;
        $oHou-=5;
        $(".dt-img .show-bg").css({"left":$ys+"px"});
        $(".dt-img1 .show-bg").css({"left":$oHou+"px"});
        if($ys<-$(".dt-img .show-bg").outerWidth()/2){
                $ys=0;
        }
        if($oHou<-$(".dt-img1 .show-bg").outerWidth()/2){
            $oHou=0;
        }
        // console.log($jl*10)
    }





})
//获取地址栏
function getQueryString(name, url) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    if (!url || url == "") {
        url = window.location.href;
    }
    url = url.substring(url.indexOf("?"));
    r = url.substr(1).match(reg);
    if (r != null) return decodeURI(r[2]);
    return "";
}
